Thinking others have it worse and i should have little to complain about actually does work for me, but only in a normal mental state, when i was suicidal it would not have helped one little bit.
I dont know what does help in that state tbh, i scared myself with increasingly intrusive thoughts of suicide that i went to the doc and got some happy pills about 8 years ago. I resolved to be on them the shortest possible time and then quit, for me that was 6 months and it was still a bit too soon to quit, but by then i had a handle on my thinking and monitored my own moods and thoughts enough to push thru it. I've never looked back, I am the happiest i have ever been in my whole life now.
I dont know what the answer is and i doubt there is a magic bullet one size fits all. The answer may be chemical, it may be psychological or a combination of approaches, but you are the person best placed to understand and analyse yourself. One thing that does help is to listen to the tape you play yourself in your head, really tune in and listen to it, if what you tell yourself is mostly negative then you are the only one who can change that tape and with effort and practise you can do so.
Good luck....